-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Improve stability of initial state sync in Snaps UI #25375
Conversation
bbfee15
to
7d074a0
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #25375 +/- ##
========================================
Coverage 65.42% 65.42%
========================================
Files 1380 1380
Lines 54688 54688
Branches 14339 14339
========================================
Hits 35776 35776
Misses 18912 18912 ☔ View full report in Codecov by Sentry. |
Builds ready [f797264]
Page Load Metrics (46 ± 5 ms)
Bundle size diffs
|
Missing release label release-12.0.0 on PR. Adding release label release-12.0.0 on PR and removing other release labels(release-12.1.0), as PR was cherry-picked in branch 12.0.0. |
Description
Improves stability of initial state sync when using Snaps UI. Previously, sometimes, the
initialState
in theSnapInterfaceContext
wouldn't be updated when the content of the interface changed and thus initial values would be missing.This PR changes the implementation to use one selector in the renderer, which only changes when the content does, but passes the
initialState
andcontext
to theSnapInterfaceContext
itself. This way we are guaranteed for the content and state to stay in sync.Can be tested with a Snap like: